#include "headfiles.h"

using namespace std;

int main(int argc, char **argv) {
    if (argc != 3) {
        cout << "Usage: " << argv[0] << " book_name word" << endl;
        return 0;
    }

    string book_name(argv[1]);
    string word(argv[2]);

    int word_freq;
    word_freq = calcWordFreq(book_name.c_str(), word);

    if (word_freq == -1) {
        cout << "Word " << word << " does not exist in book " << book_name << "." << endl;
    }
    else {
        cout << "Count of word " << word << " in book is " << endl;
        cout << word_freq << "." << endl;
    }

    return 0;
}

